﻿<UserControl x:Class="TestClient.UserControls.RowSummariesPlacerControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:ExtendedGridControl="clr-namespace:ExtendedGrid.ExtendedGridControl;assembly=ExtendedGrid"
             xmlns:ExtendedColumn="clr-namespace:ExtendedGrid.ExtendedColumn;assembly=ExtendedGrid"
             xmlns:Classes="clr-namespace:ExtendedGrid.Classes;assembly=ExtendedGrid"
             xmlns:UserControls="clr-namespace:TestClient.UserControls" mc:Ignorable="d" 
             d:DesignHeight="600" d:DesignWidth="600">
    <UserControl.Resources>
        <!--Attach Default Fluent Control's Theme-->
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
            </ResourceDictionary.MergedDictionaries>
            <!--ScrollViewer Preview Tooltip DataTemplate1-->
          
        </ResourceDictionary>
        
    </UserControl.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="5" />
            <RowDefinition Height="0.6*" />
        </Grid.RowDefinitions>
        <StackPanel Orientation="Vertical">
            <ContentControl  HorizontalAlignment="Stretch"  >
                <DockPanel LastChildFill="True">
                    <Image Source="../Images/help.ico" Height="16" HorizontalAlignment="Left" DockPanel.Dock="Left"></Image>
                    <Border Background="LightYellow" Height="22">
                        <TextBlock Background="LightYellow" VerticalAlignment="Center" HorizontalAlignment="Stretch" FontWeight="Bold">Row summaries for string and numbers will differ as shown below</TextBlock>
                    </Border>

                </DockPanel>
            </ContentControl>
            <ExtendedGridControl:ExtendedDataGrid GroupByControlVisibility="Collapsed" ShowRowSummaries="True" Height="500" VerticalAlignment="Top" x:Name="grid" ItemsSource="{Binding SourceTable}" RowHeaderWidth="17"  AutoGenerateColumns="False" HideColumnChooser="False" 
                                              IsSynchronizedWithCurrentItem="True"  SelectionMode="Extended" SelectionUnit="CellOrRowHeader" RowSummarySumFormat="[#]">

                <DataGrid.Columns>
                    <ExtendedColumn:ExtendedDataGridTextColumn Header="Game Name" AllowAutoFilter="False"
                                           Binding="{Binding GameName}" />
                    <ExtendedColumn:ExtendedDataGridTextColumn Header="Creator" AllowAutoFilter="False"
                                           Binding="{Binding Creator}" />
                    <ExtendedColumn:ExtendedDataGridTextColumn Header="Owner"
                                           Binding="{Binding Owner}" AllowAutoFilter="False"/>
                    <ExtendedColumn:ExtendedDataGridTextColumn Header="Publisher"
                                           Binding="{Binding Publisher}" AllowAutoFilter="False"
                                           CanUserSort="False" Width="*"/>
                    <ExtendedColumn:ExtendedDataGridTextColumn Header="Count"
                                           Binding="{Binding Count}" AllowAutoFilter="False"
                                           CanUserSort="False" Width="*">
                        <ExtendedColumn:ExtendedDataGridTextColumn.SummaryColumnSettings>
                            <Classes:SummaryColumnSettings>
                                <Classes:SummaryColumnSettings.SummaryOperands>
                                    <Classes:SumSummaryOperands/>
                                    <Classes:CountSummaryOperands/>
                                </Classes:SummaryColumnSettings.SummaryOperands>
                            </Classes:SummaryColumnSettings>
                        </ExtendedColumn:ExtendedDataGridTextColumn.SummaryColumnSettings>
                    </ExtendedColumn:ExtendedDataGridTextColumn>


                </DataGrid.Columns>
                <ExtendedGridControl:ExtendedDataGrid.FooterDataTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="RowsCount:" FontWeight="Bold"/>
                            <TextBlock Margin="3,0,0,0" Foreground="DarkGreen"  Text="{Binding ElementName=grid,Path=Items.Count}"></TextBlock>
                        </StackPanel>
                    </DataTemplate>
                </ExtendedGridControl:ExtendedDataGrid.FooterDataTemplate>
            </ExtendedGridControl:ExtendedDataGrid>
        </StackPanel>
        <GridSplitter Grid.Row="1" HorizontalAlignment="Stretch" Height="5"></GridSplitter>
        <UserControls:CodeViewer x:Name="codeViewer" Grid.Row="2">
        </UserControls:CodeViewer>
    </Grid>
</UserControl>
